<!-- eslint-disable max-len -->
<template>
  <div class="h100 taskVerifyDetail">
    <!-- 操作栏 -->
    <div class="taskVerifyDetailFooter" style="width:100%;display:flex;">
      <div style="transform:scale(0.9);margin-left:-20px;flex:1"><swSteps :activeIndex="activeIndex"></swSteps></div>
      <div v-if="isNotDraft && sjzt && !fzzt" style="transform:scale(0.9);display:flex">
        <div style="display:flex;margin-right:10px">
          <div style="display:flex;flex-direction: column">
            <a-button style="margin-bottom: 20px" v-if="sjzt=='onshelfed'">
              <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
              <span class="ok titleBold">{{ $t('onshelfed') }}</span>
            </a-button>
            <a-button style="margin-bottom: 20px" v-if="sjzt=='offshelfed'">
              <span class="titleBold">{{ $t('formStatus')+"：" }}</span>
              <span class="titleBold">{{ $t('offshelfed') }}</span>
            </a-button>
            <a-button>
              <span class="titleBold ">{{ $t('completeTime')+"：" }}</span>
              <span class="normal titleBold">{{ endTime }}</span>
            </a-button>
          </div>
        </div>
        <div style="margin-top:50px">
          <auth-button :auth="mcPerms.sj" v-if="sjzt=='offshelfed'" type="primary" @click="sj">
            {{ '上架表单' }}
          </auth-button >
          <auth-button :auth="mcPerms.xj" v-if="sjzt=='onshelfed'" type="primary" @click="xj">
            {{ '下架表单' }}
          </auth-button >
          <auth-button :auth="mcPerms.repeal" v-if="sjzt=='offshelfed'&&authRepeal" type="danger" style="margin-left: 10px" @click="fz">
            {{ $t('repeal') }}
          </auth-button >
        </div>
      </div>
    </div>
    <!-- 查看软件管控申请表单 -->
    <div class="taskVerifyDetailTop" style="background:#ECECEC;" ref="box" @scroll="handleScroll($event)">
      <a-form-model
        class="detailPaddingPage"
        style="display: flex; flex-direction: column"
        :layout="formLayout"
        :model="formData"
        >
        <!-- 基本信息 -->
        <a-card class="card-radius basic-info-style" id="sw-step-1">
          <a-row :gutter="[80,10]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('vehicleModel1') }}
                </span>
                <a-input v-model="formData.modelCode" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('ecuName') }}
                </span>
                <a-input v-model="formData.ecuName" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('partNo') }}
                </span>
                <a-input v-model="formData.partNo" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('mainChip') }}
                </span>
                <a-input v-model="formData.mainChip" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isConfigFile') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.isConfigFile,yesOrNoEnumArr)" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('engineerAcademySupervisor') }}
                </span>
                <a-input :value="formData.contactPersonName && formData.contactPersonId?formData.contactPersonName+'-'+formData.contactPersonId:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  {{ $t('vehicleSub') }}
                </span>
                <a-input :value="formData.subType?formData.subType:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  <span v-if="!formData.isConfigFile">{{ $t('softwareCoding') }}</span>
                  <span v-else>{{ $t('configurationFileCode') }}</span>
                </span>
                <a-input :value="formData.softwareCode" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('planningAcademySupervisor') }}
                </span>
                <a-input :value="formData.creatorName && formData.creatorId?formData.creatorName+'-'+formData.creatorId:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('hardVersion') }}
                </span>
                <a-input :value="formData.hardVersion?formData.hardVersion:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('softVersionName')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="$t('inputVersionNameWithoutVTip')" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="formData.versionNumber||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('sjblx') }}
                </span>
                <a-input :value="formData.isConfigFile?'-':$options.filters.DictLabelFilter(formData.upgradePackType,updateFileTypeEnumArr)" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('硬件日期') }}
                </span>
                <a-input :value="formData.hardVersionDate?formData.hardVersionDate:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareDate') }}
                </span>
                <a-input :value="formData.proDate" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('dllFileClassName') }}
                </span>
                <a-input :value="formData.dllName" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="!formData.isConfigFile">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('bootVersion') }}
                </span>
                <a-input :value="formData.bootVer" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('dependencyVersion')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="$t('dependencyVersionTipOfMC')" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="formData.compatibleVersion?formData.compatibleVersion:'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <div style="display:flex;justify-content: space-between;margin-bottom: -1px;margin-top: -1px;" class="myLabel">
                  <span>
                  <span class="requiredStar">*</span>
                    {{ $t('sxType')+" :" }}
                  </span>
                  <question-mark-tip :tip-title="'烧写类型VDS（CAN/CANFD）、VDS（以太网）默认支持OTA升级。'" :popupContainer="getPopupContainer">
                  </question-mark-tip>
                </div>
                <a-input :value="$options.filters.DictLabelFilter(formData.ecuReprogramType,flushTypeEnumArr2)||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('timeoutPeriod') }}
                  </span>
                  <a-input :value="formData.timeout" readOnly/>
                </a-form-model-item>
                </a-col>
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('suitableVehicleConfig') }}
                  </span>
                  <a-input :value="formData.modelConfigure?formData.modelConfigure:'-'" readOnly/>
                </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="16" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('burnSpecification') }}
                </span>
                <a-textarea :value="formData.criterion||'-'" :rows="4" style="resize:none;height:200px" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('technicalPerformanceChange') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(Number(formData.technicalFeature),yesOrNoEnumArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
                  <template>
                    <a-form-model-item>
                    <span slot="label">
                      {{ $t('uploadVerificationMaterials') }}
                    </span>
                      <a-card class="card attachment-style" title="附件信息" size="small">
                        <p v-if="!verifyList.length">无</p>
                        <div class="attachmentItem" v-for="(item, index) in verifyList" :key="index" v-else>
                          <a @click="downloadFile(item)">
                            <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                          </a>
                        </div>
                      </a-card>
                    </a-form-model-item>
                  </template>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isTechnicalParameterChange') }}
                </span>
                <a-input :value="formData.technicalFeature?$options.filters.DictLabelFilter(Number(formData.notice),yesOrNoEnumArr):'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="16" :sm="24">
              <template>
                <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('technicalParameterChange') }}
                </span>
                  <a-textarea :value="formData.technicalParameters||'-'" :rows="4" style="resize:none;height:200px" readOnly/>
                </a-form-model-item>
              </template>
            </a-col>
          </a-row>
          <a-row :gutter="[80,10]" style="margin-top:30px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('isOverseasRegulatoryInvolve') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(Number(formData.overLawsChange),yesOrNoEnumArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
              <a-form-model-item>
                <template>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('influenceOverseasRegulatoryParams') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.overParameters,yesOrNoEnumArrString)||'-'" readOnly/>
                </template>
              </a-form-model-item>
              </a-col>
              </a-row>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  {{ $t('uploadOverseasVerificationMaterials') }}
                </span>
                <a-card class="card attachment-style" title="附件信息" size="small">
                  <p v-if="!overSeasList.length">无</p>
                  <div class="attachmentItem" v-for="(item, index) in overSeasList" :key="index" v-else>
                    <a @click="downloadFile(item)">
                      <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                    </a>
                  </div>
                </a-card>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24" v-if="isNotDraft">
              <a-row :gutter="[0,10]">
                <a-col>
                  <a-form-model-item>
                    <span slot="label">
                      {{ $t('formStatus') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter($route.query.status,formsStatusArr)||'-'" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col>
              <a-form-model-item>
                <span slot="label">
                  {{ $t('sjzt') }}
                </span>
                <a-input :value="sjzt?$t(sjzt):'-'" readOnly/>
              </a-form-model-item>
              </a-col>
              </a-row>
            </a-col>
          </a-row>
        </a-card>
         <!-- 软件用途 -->
        <a-card class="card-radius software-use-style" id="sw-step-2">
          <a-row :gutter="[80,40]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareUse') }}
                </span>
              <div style="border:1px solid #ccc;padding:10px 20px;border-radius:10px">
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('供应商选项') }}
                  </span>
                  <a-input :value="formData.softPurposeSupplierName||'-'" readOnly/>
                </a-form-model-item>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('工程师选项') }}
                  </span>
                  <a-input :value="formData.softPurposeName||'-'" readOnly/>
                </a-form-model-item>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('softwareDistributionScope') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.softStageDetailSupplier ,softwareDistributionScopeEnumArr)||'-'" readOnly/>
                </a-form-model-item>
              </div>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('modelDevelopmentStage') }}
                </span>
                <a-input :value="formData.carDevStage||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('userPerception') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.perceptible),userPerceptionEnumArr)||'-'" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span v-if="formData.carDevStage=='SOP'" class="requiredStar">*</span>
                  {{ $t('ecnEcrDcnFileDocumentUpload') }}
                </span>
                <a-card class="card attachment-style" title="附件信息" size="small">
                  <p v-if="!ECNList.length">无</p>
                  <div class="attachmentItem" v-for="(item, index) in ECNList" :key="index" v-else>
                    <a @click="downloadFile(item)">
                      <table-ellipsis :title="item.fileName" :text="item.fileName" :tableEllipsisIsTurnLine="false"/>
                    </a>
                  </div>
                </a-card>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,40]">
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('stateSummary') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(formData.stateSum,stateSummaryEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar" v-if="formData.stateSum!=1">*</span>
                  {{ $t('problemSummary') }}
                </span>
                <a-textarea :value="formData.problemsSum?formData.problemsSum:'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('degreeOfUrgency') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.isEmergency),degreeOfUrgencyEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('urgentCause') }}
                </span>
                <a-textarea :value="formData.emergencyReason||'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('isAffectsCertificationOrRegulatory') }}
                </span>
                <a-input :value="$options.filters.DictLabelFilter(Number(formData.impressApprove),yesOrNoEnumArr)||'-'" readOnly/>
              </a-form-model-item>
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('effectsItemsOrParameters') }}
                </span>
                <a-textarea :value="formData.impressCarType||'-'" :rows="4" style="resize:none" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="[80,40]">
            <a-col>
            <span class="requiredStar">*</span>
            <span class="myLabel">{{ $t('softwareChangeDescription') }}</span>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="softwareChangeDetailColumns"
                :data-source="formData.changeExplains"
                :rowKey="(record, index) => {return index}"
                :pagination="false"
                style="min-height:200px"
              >
              </a-table>
            </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>
        <!-- 文件信息 -->
        <a-card class="card-radius" id="sw-step-3">
          <div v-if="isUpdateFile">
            <div style="margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('fileInfo') }}</span></div>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="columns"
                :data-source="formData.upgradePacks"
                :pagination="false"
                style="min-height:200px"
              >
                <template #fileUploadStatusName="text,record">
                  {{ text }}
                  <a-tooltip placement="top" v-if="record.showFaildReason" :getPopupContainer="getPopupContainer">
                    <template slot="title">
                      {{ record.failReason }}
                    </template>
                    <a-icon type="exclamation-circle" :style="{ color: 'red' }"/>
                  </a-tooltip>
                </template>
                <template #primitiveVersion="text">
                  {{ text?text:'无' }}
                </template>
                <template #checksum="text">
                  <a @click="viewCheckSum(text)">{{ $t('view') }}</a>
                </template>
                <template #hashAlgorithm="text">
                  {{ $options.filters.DictLabelFilter(text,digestAlgorithm) }}
                </template>
                <template #fileReprogramType="text">
                  {{ text }}
                </template>
                <template #operation="record">
                  <!-- 升级包类型为2 是差分软件包 -->
                  <span v-if="formData.upgradePackType == 2 && isNotDraft">
                    <auth-button @click="download(record)" :loading="downloading" :disabled="!canDiffPackageDownload">{{ $t('download') }}</auth-button>
                  </span>
                  <span v-else>-</span>
                </template>
              </a-table>
            </a-form-model-item>
          </div>
          <div v-else>
            <div style="margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('fileInfo') }}</span></div>
            <div style="border:1px solid #ccc;padding:10px 20px;border-radius:10px">
              <a-row :gutter="[80,10]">
                <a-col :md="8" :sm="24">
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('zysf') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(formData.upgradePacks[0].hashAlgorithm,digestAlgorithm)||'-'" readOnly/>
                  </a-form-model-item>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('estimatedInstallTime') }}
                    </span>
                    <a-input :value="formData.upgradePacks[0].installSec?formData.upgradePacks[0].installSec+' s':'-'" readOnly/>
                  </a-form-model-item>
                  <!-- <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('file')+$t('sxType') }}
                    </span>
                    <a-input :value="$options.filters.DictLabelFilter(formData.upgradePacks[0].fileReprogramType,fileFlushTypeEnumArr)||'-'" readOnly/>
                  </a-form-model-item> -->
                </a-col>
                <a-col :md="8" :sm="24">
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('zyz') }}
                    </span>
                    <a-input :value="formData.upgradePacks[0].checksum||'-'" readOnly/>
                  </a-form-model-item>
                  <a-form-model-item>
                    <span slot="label">
                      <span class="requiredStar">*</span>
                      {{ $t('configFile') }}
                    </span>
                    <a-card class="card attachment-style" title="文件信息" size="small" style="height:100px">
                      <!-- <a class="attachmentItem" @click="downloadConfigFile"> -->
                      <a class="attachmentItem">
                        <table-ellipsis :title="formData.upgradePacks[0].fileName" :text="formData.upgradePacks[0].fileName" :tableEllipsisIsTurnLine="false"/>
                      </a>
                    </a-card>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <!-- 主程序信息 -->
            <div style="margin-top:40px;margin-bottom:10px"><span class="requiredStar">*</span><span style="fontWeight:600;">{{ $t('zcxxx') }}</span></div>
            <a-form-model-item>
              <a-table
                :scroll="{y:200}"
                :columns="mainProgramTbColumns"
                :data-source="dataFormTb"
                :pagination="false"
                style="min-height:200px"
              >
                <template slot="createTime" slot-scope="text">
                  <table-ellipsis
                    :tableEllipsisIsTurnLine="false"
                    :text="text ? $options.filters.moment(text) : '_'">
                  </table-ellipsis>
                </template>
                <template #operation="text">
                  <span class="set-margin">
                    <a-icon type="edit" />
                    <a @click="clickRowOperation('edit',text)">{{ $t('edit') }}</a>
                  </span>
                  <span>
                    <i class="iconfont icon-shanchu deleteUlr"> </i>
                    <a @click="clickRowOperation('delete',text)">{{ $t('delete') }}</a>
                  </span>
                </template>
              </a-table>
            </a-form-model-item>
          </div>
        </a-card>
        <!-- 测试信息 -->
        <a-card class="card-radius" id="sw-step-4">
          <a-form-model-item >
            <table class="testInfo" cellspacing="0" cellpadding="0">
              <!-- 软件开发匹配测试计划 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('softwareMatchesPlans')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in testPlanList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
              <!-- 软件需求分析说明书 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('softwareRequirementsAnalysis')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in demandList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 静态测试报告 -->
              <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('staticTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in staticList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 单元测试报告 -->
               <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('unitTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in unitTestList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 集成测试报告 -->
               <tr>
                <td class="td1">
                  <!-- <span class="requiredStar">*</span> -->
                  {{ $t('integrationTestReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in integrationList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 黑盒测试与匹配报告 -->
               <tr>
                <td class="td1">
                  <span class="requiredStar">*</span>
                  {{ $t('blackBoxMatchReport')+'：' }}
                </td>
                <td class="td2">
                  <span class="mr8 info-style" v-for="(item, index) in blackTestList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
               <!-- 软件释放单 -->
               <tr>
                <td class="td1">
                  <span class="requiredStar">*</span>
                  {{ $t('softwareReleaseSheet')+'：' }}
                </td>
                <td class="td2">
                 <span class="mr8 info-style" v-for="(item, index) in releaseList" :key="index">
                      <a @click="downloadFile(item)">{{item.fileName}}</a>
                  </span>
                </td>
              </tr>
            </table>
          </a-form-model-item>
          <a-row :gutter="80" class=" software-use-style" style="margin-top:20px">
            <a-col :md="8" :sm="24">
              <a-row :gutter="[0,10]">
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('testConclusion') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.engTestVerdict,passOrNot)||'-'" readOnly/>
                </a-form-model-item>
                </a-col>
                <a-col>
                <a-form-model-item>
                  <span slot="label">
                    <span class="requiredStar">*</span>
                    {{ $t('internalControl') }}
                  </span>
                  <a-input :value="$options.filters.DictLabelFilter(formData.controlled,yesOrNoEnumArr)||'-'" readOnly/>
                </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <a-col :md="16" :sm="24">
              <a-form-model-item>
                <span slot="label">
                  <span class="requiredStar">*</span>
                  {{ $t('testSummary') }}
                </span>
                <a-textarea :value="formData.engTestSummary||'-'" :rows="4" style="resize:none;height:200px" readOnly/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-card>
        <!-- 发布说明 -->
        <a-card class="card-radius" id="sw-step-5">
          <div>
            <a-form-model-item :label="$t('versionDescription')" :rules="{required:true}">
              <a-textarea v-model="formData.versionDesc" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('funcAdd')" :rules="{required:true}">
              <a-textarea v-model="formData.funcFeature" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('funcOptimize')" :rules="{required:true}">
              <a-textarea v-model="formData.funcOptimize" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
            <a-form-model-item :label="$t('specialThanks')">
              <a-textarea :value="formData.specialThanks||'-'" :rows="4" style="resize:none" readOnly/>
            </a-form-model-item>
          </div>
        </a-card>
        <!-- 申请人信息 -->
        <a-card class="card-radius apply-card" id="sw-step-6">
          <a-form-model-item>
            <a-row :gutter="80">
              <a-col :md="8" :sm="24">
                <a-form-model-item label="申请人姓名">
                  <a-input :value="formData.applyUserName.substring(0,formData.applyUserName.indexOf('('))||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="工号">
                  <a-input :value="formData.applyUserId||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="邮箱">
                  <a-input :value="formData.applyUserEmail||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="所属组织架构">
                  <a-input :value="formData.applyUserOrgName||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="电话">
                  <a-input :value="formData.applyPhone||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-model-item label="申请日期">
                  <a-input :value="formData.applyTime||'-'" readOnly/>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-form-model-item>
          <a-row v-if="isNotDraft">
            <!-- 流程名称 -->
            <a-col :md="8" :sm="8">
              <a-row>
                <a-col :md="9" :sm="24">
                  <a-form-model-item class="boldTitle">
                    {{ $t('flowName') }}
                  </a-form-model-item>
                </a-col>
                <a-col :md="12" :sm="24">
                  <a-form-model-item>
                    {{ definitionName }}
                  </a-form-model-item>
                </a-col>
              </a-row>
            </a-col>
            <!-- 撤回类型 -->
            <a-col :md="8" :sm="8">
              <a-row>
                <a-col :md="9" :sm="24">
                  <a-form-model-item class="boldTitle">
                    {{ $t('withdrawType') }}
                  </a-form-model-item>
                </a-col>
                <a-col :md="12" :sm="24">
                  <a-form-model-item>
                    {{ cancelType }}
                  </a-form-model-item></a-col>
              </a-row>
            </a-col>
          </a-row>
          <!-- 审核节点列表 -->
          <display-unstarted-tb-list :lists="auditLists" v-if="unStartedAudit"></display-unstarted-tb-list>
          <display-tb-list :lists="auditLists" v-else></display-tb-list>
        </a-card>
        <!-- 查看摘要值 -->
        <a-modal v-model="showCheckSum" :title="$t('zyz')">
          <template slot="footer">
            <a-button key="back" @click="showCheckSum=false">
              {{ $t('back') }}
            </a-button>
          </template>
          <p>{{ checkSumToModal }}</p>
        </a-modal>
      </a-form-model>
    </div>
  </div>
</template>
<script>
import {downloadBlobFile} from "@/utils/functions";
import swSteps from '@/views/components/step/swSteps.vue'
import AuthButton from '@/components/AuthButton'
import { mcPerms } from '@/config/permission/index'
import { writeFileStream } from '@/utils/functions'
import QuestionMarkTip from '@/views/components/QuestionMarkTip'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import DisplayUnstartedTbList from '@/views/components/AuditFlowProcess/displayEditableTb.vue'
import DisplayTbList from '@/views/components/AuditFlowProcess/displayTbList.vue'
import ProcessViewer from '@/components/ProcessViewer'
import { DOWNLOAD_FILE_WITH_ID } from '@/config/fetchURL'
import {axios} from '@/utils/request'
import { minxinScrollTop } from '@/utils/mixin.js'
// eslint-disable-next-line max-len
import { uploadedFileTableColumnsNoActDraft, uploadedFileTableColumnsNoAct, yesOrNoEnumArr,yesOrNoEnumArrString, passOrNot, attachmentColumns, softwareDistributionScopeEnumArr, degreeOfUrgencyEnumArr, userPerceptionEnumArr, stateSummaryEnumArr,  flushTypeEnumArr, updateFileTypeEnumArr, mainProgramTbColumns, formsStatusArr, softwareChangeDetailColumns } from './config/list'
export default {
  mixins:[minxinScrollTop],
  components: {
    AuthButton,
    TableEllipsis,
    QuestionMarkTip,
    DisplayUnstartedTbList,
    DisplayTbList,
    ProcessViewer,
    swSteps
  },
  data () {
    return {
      authRepeal:true,
      mcPerms,
      formLayout: 'horizontal',
      dataFormTb: [],
      ECNList:[],
      verifyList:[],
      overSeasList:[],
      testPlanList:[],
      demandList:[],
      staticList:[],
      unitTestList:[],
      integrationList:[],
      blackTestList:[],
      releaseList:[],
      formData: {
        applyTime: '',
        applyUserOrgName: '',
        applyUserName: '',
        applyUserEmail: '',
        isConfigFile: 0,
        softwareCode: '',
        compatibleVersion: undefined,
        modelCode: '',
        modelName: '',
        versionNumber: '',
        candidates: [],
        upgradePacks: [],
        upgradePackType: '',
        ecuReprogramType: ''
      },
      selectedRowKeys: [],
      auditLists: [],
      finishedInfo: {
        finishedSequenceFlowSet: [],
        finishedTaskSet: [],
        unfinishedTaskSet: [],
        rejectedTaskSet: []
      },
      processView: {
        index: '',
        xmlData: ''
      },
      formItemLayout: {
        labelCol: { span: 1 },
        wrapperCol: { span: 23 }
      },
      yesOrNoEnumArr,
      yesOrNoEnumArrString,
      passOrNot,
      softwareDistributionScopeEnumArr,
      degreeOfUrgencyEnumArr,
      userPerceptionEnumArr,
      attachmentColumns,
      stateSummaryEnumArr,
      ecuOptionArr: [],
      isUpdateFile: true,
      flushTypeEnumArr,
      updateFileTypeEnumArr,
      flushTypeEnumArr2: [],
      softwareChangeDetailColumns,
      mainProgramTbColumns,
      disableFlushBtn: true,
      verisonList: [],
      carModelArr: [],
      checkSumToModal: '',
      showCheckSum: false,
      digestAlgorithm: [{ value: 1, name: 'MD5' }, { value: 2, name: 'SHA256' }],
      fileFlushTypeEnumArr: [],
      unStartedAudit: true,
      downloading: false,
      isNotDraft: true,
      definitionName: '',
      cancelType: '',
      formsStatusArr,
      endTime:undefined,
      canDiffPackageDownload:false
    }
  },
   activated(){
    this.getSoftwareUse()
    this.getSoftUseEngineer()
    this.getFormInfo();
    this.checkDownLoad()
  },
  computed: {
    columns () {
      return this.$route.query.t === '2' ? uploadedFileTableColumnsNoAct : uploadedFileTableColumnsNoActDraft
    },
    // 因为操作后需要关闭标签，所以引入该状态
    visitedViews () {
      return this.$store.state.tagsView.visitedViews
    },
    sjzt () {
      if (this.$route.query.shelf === 'not') {
        return null
      } if (this.$route.query.shelf === '10') {
        return 'onshelfed'
      }
      return 'offshelfed'
    },
    fzzt(){
      if(this.$route.query.status == '100'){
        return 'fz'
      }
      return null
    }
  },
  created () {
    // 转译烧写类型
    const p1 = this.$api.searchFlushTypeRelated(3).then(res => {
      this.flushTypeEnumArr2 = res.data.map((item) => {
        return {
          value: item.code,
          name: item.name
        }
      })
    })

    // 获取文件烧写类型的下拉，以便进行转译反显
    const p2 = this.$api.searchFlushType().then(res => {
      this.fileFlushTypeEnumArr = res.data.map((item) => {
        return { value: item.code, name: item.name }
      })
    })
    Promise.all([p1, p2]).then(() => {
      this.getFormInfo()
    }).catch(() => {
      this.getFormInfo()
    })
  },
  watch:{
    isUpdateFile:{
      handler(){
        this.$nextTick(() => {
          this.getScrollHeight()
        })
      }
    },
    isNotDraft(){
      this.$nextTick(() => {
        this.getScrollHeight()
      })
    },
    formData:{
      deep: true,
      handler(){
        this.$nextTick(() => {
          this.getScrollHeight()
        })
      }
    },
  },
  methods: {
    // 下载差分包
    download (resource) {
      if (this.downloading) {
        return;
      }
      this.downloading=true;
      this.axios({
        url: '/file-service/file/download/resource',
        method: 'post',
        data:{
          softFormNo:this.formData.applyNumber,
          sourceVersion:resource.primitiveVersion
        },
        responseType: 'blob'
      }).then((res) => {
        downloadBlobFile(res, resource.fileName)
      }).finally(() => {
        this.downloading = false;
      })
    },
    // 上架表单
    sj () {
      const that = this
      const h = this.$createElement
      this.$confirm({
        title: that.$t('onshelfTip'),
        content: h('div', [h('b',that.$t('onshelfContent') ), h('p', that.$t('onshelfContent2'))]),
        onOk () {
          that.$api.listingForm({ id: that.$route.query.id * 1 }).then(
            () => {
              that.$nextTick(()=>{
                that.getFormInfo()
              })
            }
          )
        },
        onCancel () { }
      })
    },
    // 下架表单
    xj () {
      const that = this
      const h = this.$createElement
      this.$confirm({
        title: that.$t('offshelfTip'),
        content: h('div', [h('b',that.$t('offshelfContent') ), h('p', that.$t('offshelfContent2'))]),
        onOk () {
          that.$api.offshelfForm({ id: that.$route.query.id * 1 }).then(
            () => {
              that.$nextTick(()=>{
                that.getFormInfo()
              })
            }
          )
        },
        onCancel () { }
      })
    },
    // 废止
    fz(){
      const that = this
      const h = this.$createElement
      if(this.sjzt=='onshelfed'){
        this.$error({
          title:  h('div', [h('p',that.$t('该条软件管控表单处于“已上架”状态，不可废止') ), h('p', that.$t('请先【下架】该条软件管控表单！'))]),
          content: h('div', [h('p',[h('b',that.$t('·软件管控表单审核通过后，自动变为“已上架”状态，供其他业务模块使用。'))]), 
          h('p',[h('b',that.$t('·软件管控类表单操作【废止】，若软件管控表单已审核通过-变为“已上架”状态，需先将该软件管控表单进行【下架】操作后，方可进行【废止】'))])]),
        });
        return
      }
      this.$confirm({
        title: that.$t('repealTip'),
        content: h('div', [h('b',that.$t('repealContent') ), h('p', that.$t('repealContent2'))]),
        onOk () {
          that.$api.repealForm({ instanceId: that.$route.query.instanceId }).then(
            () => {
              that.$store.dispatch('tagsView/delView', that.$route.fullPath).then(() => {
                that.$router.replace({ path: '/mc/sf' })
              })
            }
          )
        },
        onCancel () { }
      })
    },
    // 获取软件用途
    getSoftwareUse(){
      let dictCode='sw_repo_soft_usage'
      axios({
        url: '/sw-repository/apply/drop-down-box/'+dictCode,
        method: 'get'
      }).then(res => {
          let softwareUseEnumArr = res.data
          let parseName = []
          softwareUseEnumArr.filter((item) => {
            if (item.code == this.formData.softPurposeSupplier) {
                parseName.push(item.name)
            }
          })
           this.formData.softPurposeSupplierName=parseName.toString()
      })
    },
     // 获取软件用途(工程师)
    getSoftUseEngineer(){
      let dictCode='sw_repo_soft_usage_engineer'
      axios({
        url: '/sw-repository/apply/drop-down-box/'+dictCode,
        method: 'get'
      }).then(res => {
          let softUseEngineer = res.data
          let parseName = []
          softUseEngineer.filter((item) => {
            if (item.code == this.formData.softPurpose) {
                parseName.push(item.name)
            }
          })
           this.formData.softPurposeName=parseName.toString()
      })
    },
    fileStatusFaildShow(item){
      item.showFaildReason = false
      // 加密失败，并且有结果
      if(item.resourceState == 3 && item.failReason){
         item.showFaildReason = true
      }
      return item
    },
    // 校验差分软件包是否可以下载
    checkDownLoad(){
      this.$api.checkDiffPackageDownload(this.$route.query.id).then(res=>{
        this.canDiffPackageDownload=res.data
      })
    },
    // 获取表单或者草稿信息
    getFormInfo () {
      const vm = this
      // t 表示软件管控的表单来源，1代表新建表单，2代表查看表单，3代表编辑表单草稿，4代表查看表单草稿
      if (this.$route.query.t === '2') {
        this.isNotDraft = true
        if(this.$route.query.unRepeal){
          this.authRepeal=false
        }
        this.$api.queryFormDetail(this.$route.query.id).then(res => {
          // 已经被删除
          if (res.data.deleted === 1) {
            vm.$store.dispatch('tagsView/delView', vm.visitedViews.at(-1))
              .then(() => {
                vm.$message.warning(vm.$t('sjyscwfckxq'))
                // eslint-disable-next-line max-len
                vm.$router.replace({ path: vm.visitedViews.at(-1).path, params: vm.visitedViews.at(-1).params, query: vm.visitedViews.at(-1).query })
              }
              )
          }
          if (res.data.shelveStatus) {
            if (vm.$route.query.shelf !== res.data.shelveStatus.toString()) {
              const queryChange = { ...vm.$route.query }
              queryChange.shelf = res.data.shelveStatus.toString()
              vm.$router.replace({ path: vm.$route.path, params: vm.$route.params, query: queryChange })
            }
          }
          if (vm.$route.query.status) {
            if (vm.$route.query.status !== res.data.applyStatus.toString()) {
              const queryChange = { ...vm.$route.query }
              queryChange.status = res.data.applyStatus.toString()
              vm.$router.replace({ path: vm.$route.path, params: vm.$route.params, query: queryChange })
            }
          }
          this.formData = res.data
          this.formData.upgradePacks.map((item,index) =>{
            item = this.fileStatusFaildShow(item)
          })
          this.verifyList=res.data.files.filter(item=>item.bizName=='vds_verify')
          this.overSeasList=res.data.files.filter(item=>item.bizName=='vds_over_verify')
          this.ECNList=res.data.files.filter(item=>item.bizName=='vds_ecn_ecr')
          this.testPlanList= res.data.files.filter(item=>item.bizName=='vds_plan')
          this.demandList= res.data.files.filter(item=>item.bizName=='vds_demand')
          this.staticList= res.data.files.filter(item=>item.bizName=='vds_white_report')
          this.unitTestList= res.data.files.filter(item=>item.bizName=='vds_util')
          this.integrationList= res.data.files.filter(item=>item.bizName=='vds_integration')
          this.blackTestList= res.data.files.filter(item=>item.bizName=='vds_report')
          this.releaseList= res.data.files.filter(item=>item.bizName=='vds_release')
          if (res.data.isConfigFile === 1) {
            this.isUpdateFile = false
            this.dataFormTb = res.data.nonConfigFileApplys
          }
          this.queryForFlow()
          this.getSoftwareUse()
          this.getSoftUseEngineer()
        })
      } else if (this.$route.query.t === '4') {
        this.isNotDraft = false
        this.$api.getDraftDetail(this.$route.query.id).then(res => {
          this.formData = JSON.parse(res.data.businessContent)
          this.flushTypeEnumArr2.forEach((item) => {
              if (item.value === this.formData.ecuReprogramType) {
                this.formData.ecuReprogramTypeName==item.name
              }
          })
          // this.formData = res.data
          this.verifyList=this.formData.files.filter(item=>item.bizName=='vds_verify')
          this.overSeasList=this.formData.files.filter(item=>item.bizName=='vds_over_verify')
          this.ECNList=this.formData.files.filter(item=>item.bizName=='vds_ecn_ecr')
          this.testPlanList= this.formData.files.filter(item=>item.bizName=='vds_plan')
          this.demandList= this.formData.files.filter(item=>item.bizName=='vds_demand')
          this.staticList= this.formData.files.filter(item=>item.bizName=='vds_white_report')
          this.unitTestList= this.formData.files.filter(item=>item.bizName=='vds_util')
          this.integrationList= this.formData.files.filter(item=>item.bizName=='vds_integration')
          this.blackTestList= this.formData.files.filter(item=>item.bizName=='vds_report')
          this.releaseList= this.formData.files.filter(item=>item.bizName=='vds_release')
          if(this.formData.compatibleVersion){
            this.formData.compatibleVersion = this.formData.compatibleVersion.toString()
          }
          if (this.formData.isConfigFile === 1) {
            this.isUpdateFile = false
            this.$api.getSoftwareMCList({ shelveStatus: 10,pageSize:1000 }).then(res => {
              const aArray = res.data
              this.dataFormTb = []
              aArray.forEach((item) => {
                this.formData.applyIds.forEach(item2 => {
                  if (item2 === item.id) {
                    this.dataFormTb.push(item)
                  }
                })
              })
            })
          // this.dataFormTb = res.data.nonConfigFileApplys
          }
          this.queryForFlow()
          this.getSoftwareUse()
          this.getSoftUseEngineer()
        })
      }
    },
    // 获取流程
    queryForFlow () {
      const { query } = this.$route
      // 如果是草稿或者表单状态为发起审批之前，那么获取流程图的详情需要换一个接口，如果是已经发起，则用之前已有的接口即可
      if (query.t === '4') {
        this.unStartedAudit = true
        this.$api.getSoftwareMCFlowDesinNodeData().then((res) => {
          this.auditLists = res.data
          this.auditLists.forEach((item) => {
            this.formData.candidates.forEach(item2 => {
              if (item.flowElementId === item2.flowElementId) {
                // eslint-disable-next-line no-param-reassign
                item.assignee = item2.userIds
              }
            })
          })
          this.auditLists.unshift({
            flowElementName:'申请人',
            processModeDesc:'-',
            roleCandidatesName:'-',
            assignee:this.formData.applyUserName,
            canInstanceCancelNotice:'-',
            canResultNotice:'-',
            appointElExpr:''
          })
        })
        this.$api.getSoftwareMCFlowDesinXmlData().then((res) => {
          this.processView.index = 'process' + Math.random
          this.processView.xmlData = res.data
        })
      // 如果还是草稿的话，无法查询流程图详情，只能去获取流程图和节点信息然后反显新增时的填写信息
      // || query.status === '30'待发起审批（隐藏）
      } else if (query.status === '10' || query.status === '20'  || query.status === '80') {
        this.unStartedAudit = true
        // eslint-disable-next-line max-len
        this.$api.getDraftFlowInstanceDetail({ businessCode: query.code ? query.code : 'sw_repo_audit', businessKey: query.key ? query.key : query.id }).then(res => {
          if (res.data.length > 0) {
            this.auditLists = res.data.map((item) => {
              if (item.assignee && item.assignee.includes(',')) {
                // eslint-disable-next-line no-param-reassign
                item.assignee = item.assignee.split(',')
                console.log(item.assignee, 'item.assignee')
              }
              return item
            })
            this.auditLists.unshift({
              flowElementName:'申请人',
              processModeDesc:'-',
              roleCandidatesName:'-',
              assignee:this.formData.applyUserName,
              canInstanceCancelNotice:'-',
              canResultNotice:'-',
              appointElExpr:''
            })
          }
        })
        // eslint-disable-next-line max-len
        this.$api.getFlowInstanceDetail({ businessCode: query.code ? query.code : 'sw_repo_audit', businessKey: query.key ? query.key : query.id,instanceId:query.instanceId }).then(res => {
          const { data } = res
          if (!data) {
            return
          }
          if (data.bpmnXml) {
            this.processView.index = 'process' + Math.random
            this.processView.xmlData = data.bpmnXml
          }
          if (data.viewer) {
            this.finishedInfo.finishedTaskSet = data.viewer.finishedTaskSet
            this.finishedInfo.unfinishedTaskSet = data.viewer.unfinishedTaskSet
            this.finishedInfo.rejectedTaskSet = data.viewer.rejectedTaskSet
            this.finishedInfo.finishedSequenceFlowSet = data.viewer.finishedSequenceFlowSet
          }
          if (!this.unStartedAudit) {
            this.auditLists = data.tasks
          }
          this.definitionName = data.definitionName
          this.cancelType = data.cancelType
        })
      } else {
        this.unStartedAudit = false
        // eslint-disable-next-line max-len
        this.$api.getFlowInstanceDetail({ businessCode: query.code ? query.code : 'sw_repo_audit', businessKey: query.key ? query.key : query.id, instanceId:query.instanceId}).then(res => {
          const { data } = res
          if (!data) {
            return
          }
          if (data.bpmnXml) {
            this.processView.index = 'process' + Math.random
            this.processView.xmlData = data.bpmnXml
          }
          if (data.viewer) {
            this.finishedInfo.finishedTaskSet = data.viewer.finishedTaskSet
            this.finishedInfo.unfinishedTaskSet = data.viewer.unfinishedTaskSet
            this.finishedInfo.rejectedTaskSet = data.viewer.rejectedTaskSet
            this.finishedInfo.finishedSequenceFlowSet = data.viewer.finishedSequenceFlowSet
          }
          if (!this.unStartedAudit) {
            this.auditLists = data.tasks
            this.auditLists.unshift({
              taskName:'申请人',
              processModeDesc:'-',
              candidatesName:'-',
              assignee:'-',
              actualAssignee:this.formData.applyUserName,
              urgeTimes:'-',
              taskStatusName:'发起表单申请',
              auditTime:this.formData.createTime
            })
          }
          this.definitionName = data.definitionName
          this.cancelType = data.cancelType
          this.endTime = this.$options.filters.moment(data.endTime)
        })
      }
    },
    // tooltip悬浮
    getPopupContainer () {
      return document.querySelector('.ant-modal-wrap') || document.body
    },
    // 查看摘要值
    viewCheckSum (data) {
      this.checkSumToModal = data
      this.showCheckSum = true
    },
    // 下载上传成功且处理成功的文件
    downloadFile (data) {
      writeFileStream(DOWNLOAD_FILE_WITH_ID + data.fileId, data.fileName)
    },
    // 下载配置文件
    downloadConfigFile () {
      // eslint-disable-next-line prefer-destructuring
      const data = this.formData.upgradePacks[0]
      writeFileStream(DOWNLOAD_FILE_WITH_ID + data.fileId, data.fileName)
    }
  }
}
</script>
<style lang="less" scoped>
.card-radius{
  border-radius: 10px;
  padding: 30px 80px 30px 46px;
}
.taskVerifyDetail {
  display: flex;
  flex-direction: column;
  .taskVerifyDetailTop {
    position: relative;
    flex: 1;
    overflow: auto;
    min-width: 800px;
  }
  .taskVerifyDetailFooter {
    padding: 15px 24px;
    flex: none;
    border-bottom: 1px solid @borderColor;
    .ok {
      color: #46d5a2;
      font-weight: bold;
    }
    .reject {
      color: #fe8b67;
      font-weight: bold;
    }
    .normal{
      color: #147092 ;
      font-weight: bold;
    }
    .titleBold{
      font-weight: 600;
    }
  }
}
.basic-info-style,.software-use-style{
  ::v-deep .ant-form-item{
    margin-bottom: 8px ;
  }
  ::v-deep .ant-form-item-control{
    line-height: 20px;
  }
}
.myLabel{
  font-weight: 600;
}
.apply-card{
::v-deep .ant-input{
    border-radius: 8px;
    text-align: center;
  }
}
.attachment-style{
  border:1px solid #ccc;
  border-radius: 10px;
  height: 200px;
  ::v-deep .ant-card-head{
    background: #B8BACF;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  ::v-deep .ant-card-body{
    overflow: auto;
    height: 150px;
  }
  .attachmentItem{
    height:40px;
    line-height: 40px;
    border-bottom: 1px solid #F5F5F5;
  }
}
::v-deep .ant-form-item{
margin-bottom: 8px ;
}
::v-deep .deepClass{
    font-weight: 400;
    margin-right: 38px;
    text-align: right;
}
.boldTitle{
    font-weight: 600;
    margin-right: 38px;
    text-align: right;

}
::v-deep .ant-form-item-label {
  font-weight: 600;
    line-height: 16px;
    font-size: 12px;
}
::v-deep .ant-card-bordered{
  margin-bottom: 12px;
}
.customFormModelItem2 {
  margin-bottom: 12px;
  font-size: 18px;
  }
.detailPaddingPage{
  padding: 12px;
  }
.marginProcess{
  margin-left: 4%;
  margin-right: 4%;
  }
::v-deep .ant-input[disabled] {
    color: #000;
    background-color: #f5f5f5;
    cursor: default;
    opacity: 1;
}
.set-margin {
  margin-right: 12px;
}
.testInfo{
  width:100%;
  border-collapse: separate;
  border-spacing: 1px;
  border-top: 1px solid #ccc !important;
  border-left: 1px solid #ccc !important;
  td,tr{
  border-right: 1px solid #ccc !important;
  border-bottom: 1px solid #ccc !important;
  }
  .td1{
    font-weight: 600;
    width:200px;
    text-align: right;
  };
  .td2{
    width:calc(94% - 200px);
    color:blue;
    .info-style{
      border:1px solid rgba(20, 112, 146, 100);
      padding: 5px 8px;
      border-radius: 30px;
      margin: 0 5px;
    }
  };
}
.fujianBtn{
  display: flex;
  align-items: center;
}
.mr8{
  margin-right:8px
}

</style>
